@(categorie: List[Categoria], categoriaForm: play.data.Form[Categoria],warning: Boolean,success: Boolean)

@import helper._

@main("Categoria") {

	<table>
	<td>
   	@form(routes.Application.index()) {
   			<button type="submit" class="btn btn-info btn-large"><i class="icon-arrow-left"></i> Tabelle</button>
   	}
   	</td>
    <td>
    <p style="-webkit-text-stroke: #000000 1px; font-size: 39px; color:#3ADF00">@categorie.size() Categoria(e)</p>
    </td>
    <td>
   	@form(routes.Categorie.newCategoria()) {
    	<button type="submit" class="btn btn-success btn-large" title="Nuova Categoria"><i class="icon-plus"></i></button>
    }
    </td>
    </table>
        
    @if(warning==true){
    	<div class="alert">
  			<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
  			<strong>Attenzione!</strong> Impossibile eliminare: categoria coinvolta!
		</div>
    }
    
    @if(success==true){
    	<div class="alert alert-success">
  			<button type="button" class="close" data-dismiss="alert">&times;</button>
  			<strong>Tutte le modifiche sono state salvate!</strong>
		</div>
    }
    
    
    <table class="tablesorter table table-hover table-bordered table-condensed">
    <thead>
    <tr class="success"><th><b>Denominazione</b></th><th><b>Categoria</b></th></tr>
    </thead>
    <tbody>  
        @for(categoria <- categorie) {
                <tr class="info">       	
                <td> @categoria.denominazione</td> <td> @categoria.categoria</td> 
                
                <td>
  					<div class="btn-group">
    					<a class="btn btn-danger btn-mini" href="@routes.Categorie.deleteCategoria(categoria.id)" title="Elimina Categoria" onclick="return confirm('Are you sure?');"><i class="icon-trash"></i></a>
    					<a class="btn btn-warning btn-mini" href="@routes.Categorie.editCategoria(categoria.id)" title="Modifica Categoria"><i class="icon-pencil"></i></a>
    				</div>
                </td>
                </tr>     
        }
    </tbody>  
    </table>
    
    <div id="pager" class="pager">
	<form>
		<img src="@routes.Assets.at("tablesorter/addons/pager/first.png")" class="first"/>
		<img src="@routes.Assets.at("tablesorter/addons/pager/prev.png")" class="prev"/>
		<input type="text" class="pagedisplay"/>
		<img src="@routes.Assets.at("tablesorter/addons/pager/next.png")" class="next"/>
		<img src="@routes.Assets.at("tablesorter/addons/pager/last.png")" class="last"/>
		<select class="pagesize">
			<option selected="selected"  value="10">10</option>
			<option value="20">20</option>
			<option value="30">30</option>
			<option  value="40">40</option>
		</select>
	</form>
	</div>

}